<?php
require_once realpath (dirname (__FILE__) . '//..//pages.php');
require_once INC_FUNCTIONS;
require_once INC_DEFINES;

checkSession ();

$url = HTTP_CTRL_MAIN . '?account=login';

if (isset ($data['redirect'])) {
    $url .= '&redirect=' . $data['redirect'];
}

echo doctype ();
?>
<html>
    <?php echo head (PAGE_TITLE, array (HTTP_CSS_LOGIN, HTTP_CSS_STYLE, HTTP_CSS_MENU), array (HTTP_SCRIPT_SLEEP)); ?>
    <body>
    </body>
    <?php require_once VW_MENU; ?>
    <h1>Accedi</h1>
    <form action="<?php echo $url; ?>" method="post">
        <label>Username: <input name="username" type="text" /></label><br>
        <label>Password: <input name="password" type="password" /></label><br>
        <button class="button grey" type="submit" >Login!</button>
    </form>
</html>
